package Share;

import java.io.*;
import java.net.*;

public class Connection {
	private Socket socket; 
	
	public Connection(String server, int port) throws UnknownHostException, IOException
	{
		socket = new Socket(server, port);
	}
	
	public Connection(Socket socket)
	{
		this.socket = socket;
	}
	
	public SecureInputStream getInputStream() throws IOException
	{
		return new SecureInputStream(socket.getInputStream());
	}
	
	public SecureOutputStream getOutputStream() throws IOException
	{
		return new SecureOutputStream(socket.getOutputStream());
	}
	
	public void close() throws IOException
	{
		socket.close();
	}
}
